Repository navigation
fix(plugin): evaluate clock-based time conditions without request values - #8538
sunnysabor wants to merge 1 commit into
Conversation
Aias00
left a comment
There was a problem hiding this comment.
Stream Agent analysis
Targeted fix lets clock-based TIME_BEFORE/TIME_AFTER conditions be evaluated through the shared predicate factory when no request parameter name is configured; adds regression coverage for both operators and named-parameter controls.
Evidence: ["Complete diff attachment (complete_diff=true) read in full: PredicateJudgeFactory.java reorders the blank-realData guard and adds usesCurrentTime(), exempting TimerBefore/TimerAfter judges with an empty paramName from the early false so clock-mode comparison runs; named-param conditions and BlankPredicateJudge behavior are unchanged, and instanceof on a possibly-null judge is safe.","PredicateJudgeFactoryTest.java adds testClockBasedTimeConditionsWithoutRequestValue covering both operators with null/empty paramName and null/blank realData (assertTrue) plus named-param controls (assertFalse).","CI metadata: 70 checks, diagnosis CI_PASSED, no failed checks (also confirming the new judge class references compile); no tests were executed by this review. Supplementary source-file reads were unavailable, but both complete file patches were present in the attachment."]
Next steps: []
Verdict: PASS; publication: APPROVE (EXPLICIT_PASS)
Findings: []
Scope: captured GitHub evidence only; no local tests were executed.
Task: abbda943-a014-4ac4-aafc-f67dcc8a4a7f Commit: 33032a0827479a9970690aeab88d019c4555c2b5
Problem and change
TimeBeforeandTimeAfteruse the gateway clock when the condition has no parameter name. The shared predicate factory currently returns false before calling either judge if parameter extraction returns an empty value. For example, a nameless time condition with a header parameter type yields an empty request value and never reaches the clock comparison.Let both time judges evaluate when the parameter name is null or empty, matching their existing clock-mode check. Time conditions with a named request parameter still require a non-blank value. Other operators retain their existing behavior.
This follows up on #6555 and #8357, which addressed behavior inside the time judges.
IssueSpec
IssueSpec-Mode: lightweight
IssueSpec-Reason: This change restores the time judges' existing clock-based behavior through the shared predicate factory, using the current configuration and APIs.
IssueSpec-Validation: The factory regression failed on master at 037d6f1 and passed with the patch. The 11-module reactor passed with
./mvnw -B -ntp -o -pl :shenyu-plugin-base -am test, including Checkstyle. The plugin-base module passed Apache RAT, and the branch diff passedgit diff --check. The full repository install and deployed gateway tests were not run../mvnw clean install -Dmaven.javadoc.skip=true.